/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.heathrowapi.dto;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author nekdo
 */
public class UserDTO implements Serializable
{

    private Long id;
    private String username;
    private Set<String> roles;

    public Set<String> getRoles()
    {
        return Collections.unmodifiableSet(roles);
    }

    public void setRoles(Set<String> roles)
    {
        this.roles = new HashSet<String>(roles);
    }

    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public String getUsername()
    {
        return username;
    }

    public void setUsername(String username)
    {
        this.username = username;
    }

    @Override
    public int hashCode()
    {
        int hash = 3;
        hash = 37 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        final UserDTO other = (UserDTO) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
            return false;
        return true;
    }

    @Override
    public String toString()
    {
        return "UserDTO{" + "id=" + id + ", username=" + username + '}';
    }
}
